/*
Copyright 2007 Raymond Giorgi

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
 */

package edu.pitt.CS2510.Messages;

import edu.pitt.CS2510.Nodes.Node;

/**
 * 
 * @author NoOne
 * 
 *         Sent from a Supervisor to the central when it wants additional
 *         'backup'
 */
public class RequestMessage extends Message {
	private final int no;

	/**
	 * 'no' is the amount of additional backup that's being requested.
	 * 
	 * @param to
	 * @param from
	 * @param no
	 */
	public RequestMessage(int to, int from, int no) {
		super(to, from);
		this.no = no;
	}

	/**
	 * calls the central node's 'processRequestMessage'
	 */
	@Override
	public void processMessage(Node node) {
		node.getMessageHandler().processRequestMessage(from, no);
	}
}
